package userInterface;

import java.awt.Color;

public class Curve extends DrawObject
{
	public Curve(Point start, Point ctl1, Point ctl2, Point end, int thickness, Color color)
	{
		super(color);
		super.setShape(Shape.CURVE);
		_start = start;
		_ctl1 = ctl1;
		_ctl2 = ctl2;
		_end = end;
		_thickness = thickness;
	}
	
	public Curve(Curve c)
	{
		super(c.getColor());
		super.setShape(Shape.CURVE);
		_start = new Point(c.getStart().X, c.getStart().Y);
		_ctl1 = new Point(c.getCtl1().X, c.getCtl1().Y);
		_ctl2 = new Point(c.getCtl2().X, c.getCtl2().Y);
		_end = new Point(c.getEnd().X, c.getEnd().Y);
		_thickness = c.getThickness();
	}

	public Point getStart()
	{
		return _start;
	}
	
	public void setStart(Point start)
	{
		_start = start;
		for (DrawingModel m : _models)
			m.modelChanged();
	}
	
	public Point getEnd()
	{
		return _end;
	}
	
	public void setEnd(Point end)
	{
		_end = end;
		for (DrawingModel m : _models)
			m.modelChanged();
	}
	
	public Point getCtl1()
	{
		return _ctl1;
	}
	
	public void setCtl1(Point ctl1)
	{
		_ctl1 = ctl1;
		for (DrawingModel m : _models)
			m.modelChanged();
	}
	
	public Point getCtl2()
	{
		return _ctl2;
	}
	
	public void setCtl2(Point ctl2)
	{
		_ctl2 = ctl2;
		for (DrawingModel m : _models)
			m.modelChanged();
	}
	
	public int getThickness()
	{
		return _thickness;
	}
	
	public void setThickness(int thickness)
	{
		_thickness = thickness;
		for (DrawingModel m : _models)
			m.modelChanged();
	}
	
	@Override
	public void move(int x, int y) 
	{
		_start.X += x;
		_end.X += x;
		_ctl1.X += x;
		_ctl2.X += x;
		_start.Y += y;
		_end.Y += y;
		_ctl1.Y += y;
		_ctl2.Y += y;
		
		for (DrawingModel m : _models)
			m.modelChanged();
	}

	private Point _start;
	
	private Point _ctl1;
	
	private Point _ctl2;
	
	private Point _end;
	
	private int _thickness;

}
